package net.news.entity;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * NewsType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="NewsType"
    ,schema="dbo"
    ,catalog="CMUNEWS"
)

public class NewsType  implements java.io.Serializable {


    // Fields    

     private Integer id;
     private String typeText;
     private Set<News> newses = new HashSet<News>(0);


    // Constructors

    /** default constructor */
    public NewsType() {
    }

    
    /** full constructor */
    public NewsType(String typeText, Set<News> newses) {
        this.typeText = typeText;
        this.newses = newses;
    }

   
    // Property accessors
    @Id @GeneratedValue
    
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    @Column(name="typeText", length=50)

    public String getTypeText() {
        return this.typeText;
    }
    
    public void setTypeText(String typeText) {
        this.typeText = typeText;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="newsType")

    public Set<News> getNewses() {
        return this.newses;
    }
    
    public void setNewses(Set<News> newses) {
        this.newses = newses;
    }
   








}